using System.Collections;
using System.Collections.Generic;
using UnityEngine;

public partial class ARPGTestGroundBehaviour : BasePoolElement
{
    Vector2Int id;
    List<ARPGTestBoarBehaviour> monsters;
    public void InitID(Vector2Int id) {
        this.id = id;
        transform.position = new Vector3(id.x * 10, 0, id.y * 10);
        Vector3 pos;
        monsters = new List<ARPGTestBoarBehaviour>();
        for (int i = 0; i < 3; i++)
        {
            monsters.Add(ObjectPoolManager.Instance.DePool<ARPGTestBoarBehaviour>("ARPGTest_Boar"));
        }
        for (int i = 0; i < monsters.Count; i++)
        {
            pos = Random.insideUnitSphere * 5;
            pos.y = 0;
            monsters[i].InitBrith(transform.position + pos);
        }
    }

    private void OnDisable()
    {
        if (!Application.isPlaying) return;

        for (int i = 0; i < monsters.Count; i++)
        {
            if (monsters[i] == null) continue;
            ObjectPoolManager.Instance.EnPool(monsters[i]);
        }
    }
}


